Skip to content

Remove undefined-behavior UnsafeTests.DangerousAs to stabilize jitstress leg#129793

Open
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-unsafe-tests-dangerous-as
Open

Remove undefined-behavior UnsafeTests.DangerousAs to stabilize jitstress leg#129793
Copilot wants to merge 2 commits into
mainfrom
copilot/fix-unsafe-tests-dangerous-as

Conversation

Copilot AI commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

This change addresses an intermittent failure in System.Runtime.CompilerServices.UnsafeTests.DangerousAs on jitstress ARM runs. The test asserted behavior from an invalid cast path (Unsafe.As<string>(object)) where the result is undefined.

Fixes #129678

Copilot AI requested review from Copilot and removed request for Copilot June 24, 2026 10:53
@jkotas jkotas added area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI and removed area-Infrastructure labels Jun 24, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

Co-authored-by: jkotas <6668460+jkotas@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot June 24, 2026 11:27
Copilot AI changed the title [WIP] Fix test failure in UnsafeTests.DangerousAs Remove undefined-behavior UnsafeTests.DangerousAs to stabilize jitstress leg Jun 24, 2026
Copilot AI requested a review from jkotas June 24, 2026 11:29
@jkotas jkotas marked this pull request as ready for review June 24, 2026 11:32
@jkotas jkotas requested review from EgorBo and Copilot June 24, 2026 11:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes a unit test that exercises Unsafe.As<string>(object) on an incompatible runtime type, which can produce runtime/JIT-dependent behavior and intermittently fail under stress configurations (e.g., ARM jitstress). The remaining As() test still validates the supported/meaningful usage (object containing a string cast to string).

Changes:

  • Deleted UnsafeTests.DangerousAs (invalid cast scenario) from UnsafeTests.cs.
  • Left the existing As() test intact.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Test failure: System.Runtime.CompilerServices.UnsafeTests.DangerousAs

4 participants